<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common::heads(~{::title},~{},~{},~{})">
  <title>首页</title>
</head>

<body data-theme="light">

<!--头部导航-->
<ul class="bsa-header">
  <!-- 侧边栏触发按钮(移动端时显示) -->
  <li class="bsa-sidebar-toggler" data-bsa-toggle="pushmenu">
    <div class="bsa-header-item">
      <i class="bi bi-list"></i>
    </div>
  </li>
  <!--  搜索组件(不需要可删除)  -->
  <li>
    <div class="bsa-header-item bsa-cursor-default">
      <!--    搜索表单包裹区域        -->
      <div class="bsa-search-form-wrapper"
           data-action="pages/search.html"
           data-bsa-toggle="navbar-search"
           data-close-reset="false"
           data-params='{"type":"article","user":"admin2"}'>
        <div class="bsa-search-form">
          <input aria-label="搜索关键词" class="form-control bsa-input-search" placeholder="搜索关键词"
                 type="text">
          <button class="bsa-search-submit-btn" type="submit"><i class="bi bi-search"></i></button>
          <button class="bsa-search-close-btn" type="button"><i class="bi bi-x-lg"></i></button>
        </div>
      </div>
      <!--    移动端搜索表单触发器(移动端会显示)        -->
      <i class="bi bi-search bsa-search-form-toggler bsa-cursor-pointer"></i>
    </div>
  </li>
  <!--  占位(可以让后面的li居右)  -->
  <li class="flex-grow-1"></li>
  <!--  通知(如果有新消息则添加类名.bsa-has-msg)  -->
  <li>
    <div class="bsa-header-item" data-qt-tab='{"title":"消息中心","url":"pages/message.html"}'
         data-qt-target=".qtab">
      <i class="bi bi-bell bsa-has-msg"></i>
    </div>
  </li>
  <!--  拓展菜单(建议把拓展放在此处,以免破坏头部整体布局,不需要可以直接删除)  -->
  <li class="dropdown">
    <div class="bsa-header-item" data-bs-auto-close="outside" data-bs-toggle="dropdown">
      <i class="bi bi-grid"></i>
    </div>
    <div class="dropdown-menu dropdown-menu-end p-0">
      <div class="card shadow-sm">
        <div class="card-header d-flex justify-content-between bg-body">
          <span class="bsa-fs-15">拓展菜单</span>
          <a class="bsa-fs-13 text-decoration-none text-body-secondary" href="javascript:">编辑</a>
        </div>
        <div class="card-body">
          <div class="container-fluid">
            <div class="row row-cols-3 g-3">
              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary  bsa-wh-45 rounded-circle">
                  <i class="bi bi-envelope"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">邮箱</div>
              </a>

              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="pages/lockscreen.html">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-lock"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">锁屏</div>
              </a>

              <a
                      class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                      href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">前台直达</div>
              </a>

              <a
                      class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                      href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">拓展菜单4</div>
              </a>
              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">拓展菜单5</div>
              </a>
              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">拓展菜单6</div>
              </a>
              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">拓展菜单7</div>
              </a>

              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">拓展菜单8</div>
              </a>

              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">拓展菜单9</div>
              </a>

              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">拓展菜单10</div>
              </a>

              <a class="col text-decoration-none text-body-secondary d-flex flex-column align-items-center p-2 gap-1"
                 href="javascript:">
                <div
                        class="d-flex align-items-center justify-content-center bsa-fs-25 bg-body-secondary bsa-wh-45 rounded-circle">
                  <i class="bi bi-link"></i>
                </div>
                <div class="bsa-fs-14 bsa-ellipsis-2 text-center">拓展菜单11</div>
              </a>

            </div>
          </div>
        </div>
        <div class="card-footer text-center bg-body">
          <a class="bsa-fs-14 text-decoration-none text-body-secondary" href="javascript:">查看更多菜单</a>
        </div>
      </div>
    </div>
  </li>
  <!--  全屏  -->
  <li class="bsa-fullscreen-toggler">
    <div class="bsa-header-item">
      <i class="bi bi-arrows-fullscreen"></i>
    </div>
  </li>
  <!--  主题配色  -->
  <li class="dropdown">
    <div class="bsa-header-item" data-bs-auto-close="outside" data-bs-toggle="dropdown">
      <i class="bi bi-palette"></i>
    </div>
    <div class="dropdown-menu dropdown-menu-end p-0">
      <div class="card shadow-sm">
        <div class="card-header d-flex justify-content-between bg-body">
          <span class="bsa-fs-15">主题配色</span>
        </div>
        <div class="card-body">
          <!--    配色包裹      -->
          <div class="bsa-theme-switcher-wrapper">
            <input class="form-check-input" type="checkbox" value="light">
            <input class="form-check-input" type="checkbox" value="dark">
            <input class="form-check-input" type="checkbox" value="indigo">
            <input class="form-check-input" type="checkbox" value="green">
            <input class="form-check-input" type="checkbox" value="blue">
            <input class="form-check-input" type="checkbox" value="yellow">
            <input class="form-check-input" type="checkbox" value="pink">
            <input class="form-check-input" type="checkbox" value="red">
            <input class="form-check-input" type="checkbox" value="orange">
            <input class="form-check-input" type="checkbox" value="cyan">
            <input class="form-check-input" type="checkbox" value="teal">
          </div>
        </div>
      </div>
    </div>
  </li>
  <!--    管理员信息    -->
  <li class="dropdown">
    <div class="bsa-header-item" data-bs-toggle="dropdown">
      <div class="bsa-user-area">
        <img alt="用户头像" class="bsa-user-avatar" src="/dist/img/avatar.jpg">
        <div class="bsa-user-details">
          <div class="bsa-ellipsis-1 bsa-fs-15">欲饮琵琶码上催</div>
          <!-- 管理员角色RBAC权限设计时可用(不需要可删除,上面的用户名可自动垂直居中)  -->
          <div class="bsa-ellipsis-1 bsa-fs-13 text-muted">超级管理员</div>
        </div>
      </div>
    </div>
    <ul class="dropdown-menu dropdown-menu-end">
      <li>
        <a class="dropdown-item" data-qt-tab='{"title":"个人资料","url":"pages/profile.html"}'
           data-qt-target=".qtab"
           href="javascript:">
          <i class="bi bi-person me-2"></i>个人资料
        </a>
      </li>
      <li>
        <a class="dropdown-item bsa-clear-cache" data-qt-tab='{"title":"修改密码","url":"pages/password.html"}'
           data-qt-target=".qtab"
           href="javascript:">
          <i class="bi bi-key me-2"></i>修改密码
        </a>
      </li>
      <li>
        <div class="dropdown-divider"></div>
      </li>
      <li class="bsa-logout">
        <a class="dropdown-item" href="javascript:"><i class="bi bi-box-arrow-right me-2"></i>退出登录</a>
      </li>
    </ul>
  </li>
</ul>

<!--侧边栏-->
<div class="bsa-sidebar">
  <div class="card border-0 h-100">
    <!--  侧边栏头部(用于展示品牌logo)  -->
    <div class="card-header bg-body d-flex align-items-center flex-shrink-0">
      <img alt="logo-icon" class="bsa-logo-icon" src="/dist/img/favicon-32x32.png">
      <div class="bsa-logo-text ms-2 bsa-ellipsis-2">bootstrap-admin</div>
    </div>
    <!--  侧边栏身体部分(用于主要的侧边栏菜单)  -->
    <div class="card-body p-0" data-overlayscrollbars-initialize>
      <!--   侧边栏的菜单     -->
      <ul class="bsa-menu" data-accordion="true" data-bsa-toggle="sidebar" data-click-close="true">
        <li>
          <a href="/admin/welcome.html">
            <i class="bi bi-house"></i>首页
          </a>
        </li>
        <li>
          <a class="has-children" href="javascript:">
            <i class="bi bi-gear"></i>系统管理
          </a>
          <ul>
            <li>
              <a href="/admin/dept">部门管理</a>
            </li>
            <li>
              <a href="javascript:alert('正在开发')">用户管理</a>
            </li>
          </ul>
        </li>
      </ul>
    </div>
    <!--  侧边栏底部(用于演示,不需要可删除)  -->
    <div class="card-footer bg-body">
      Version: 2.0.1
    </div>
  </div>
</div>

<!--内容区域(.bsa-content-fixed类删除后即可变成单页版本)
-->
<div class="bsa-content bsa-content-fixed">
  <div class="qtab" data-qt-tabs='[{"title":"首页","url":"/admin/welcome.html","close":false}]'></div>
</div>

<!--版权信息-->
<div class="bsa-footer">
  <p class="mb-0">Copyright © 2023. All right reserved.</p>
</div>

<!--加载层-->
<div class="bsa-preloader">
  <div class="spinner-border text-secondary" role="status">
    <span class="visually-hidden">Loading...</span>
  </div>
</div>
<th:block th:replace="common::scripts(~{})"></th:block>
<script>
  $(document).ready(function () {

    // var {
    //   OverlayScrollbars,
    //   ScrollbarsHidingPlugin,
    //   SizeObserverPlugin,
    //   ClickScrollPlugin
    // } = OverlayScrollbarsGlobal;
    // const osInstance = OverlayScrollbars(document.querySelector('body'), {});


    //头部搜索框处理(不需要可以删除,不明白的可以看bootstrap-admin官方文档)
    $(document).on('search.bsa.navbar-search', function (e, inputValue, data) {
      //先得到请求地址,组合后大概是这样pages/search.html?keyword=dsadsa&type=article&user=admin2
      let url = data.action + '?keyword=' + inputValue + '&' + $.param(data.params);

      //然后通过tab打开一个搜索结果的窗口
      Quicktab.get('.qtab').addTab({
        title: '<i class="bi bi-search"></i><span class="text-danger ms-2">' + inputValue + '</span>',
        url: url,
        close: true,
      })
    })

    //退出登录
    $(document).on('click', '.bsa-logout', function (e) {
      e.preventDefault();
      $.modal({body: '确定要退出吗？',cancelBtn: true,ok: function () {
          $.ajax({method: 'post',url: '/logout'});
          top.location.replace('/');
        }
      })
    });
  });
</script>
</body>
</html>
